package com.xbongbong.saas.domain.entity;/*/*/

import com.alibaba.fastjson.annotation.JSONField;
import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.saas.enums.WorkOrderFlowNodeTypeEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 *
 * @author 魏荣杰
 * @date 2019/3/12 9:45
 * @since v1.0
 * @version v1.0
 */
@Setter
@Getter
@ToString
public class WorkOrderEntity extends PaasFormDataEntityExt {
    private static final long serialVersionUID = 3450873238062673066L;

    /**
     * 关联出库单id jsonarray
     */
    private String outstockId;
    /**
     * 是否全部出库 1是，0不是
     */
    private Integer allOutbound;
    /**
     * 工单状态(1未接收,2进行中,3已完成,4已关闭)
     */
    private Integer status;
    /**
     * 工单流程当前所处阶段id
     */
    private Long nowStageId;
    /**
     * 工单预计时间
     */
    private Integer expectedTime;
    /**
     * 工单实际耗时
     */
    private Integer actualTime;
    /**
     * 工单开始时间
     */
    private Long startTime;
    /**
     * 工单结束时间
     */
    private Long endTime;
    /**
     * 工单关闭时间
     */
    private Long closeTime;
    /**
     * 工单模板id
     */
    private Long templateId;
    /**
     * 工单类型，0普通工单，1抢单工单
     * @see WorkOrderFlowNodeTypeEnum
     */
    private Integer type;

    public WorkOrderEntity() {
        this.outstockId="[]";
        this.allOutbound = 0;
        this.nowStageId = 0L;
        this.expectedTime = 0;
        this.actualTime = 0;
        this.startTime = 0L;
        this.endTime = 0L;
        this.closeTime = 0L;
        this.type = 0;
    }

    /**
     * 仅仅为了不给我默认值，不覆盖更新
     * @param status
     */
    public WorkOrderEntity(Integer status) {

    }

    @JSONField(serialize = false)
    public String workOrderName() {
        return "工单" + getSerialNo();
    }

}
